<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="./css/admin.css" type="text/css" />
</head>

<body>
    <div class="container">
        <div class="menu-left">
            <ul>
                <li>新闻添加</li>
                <li>新闻列表</li>
            </ul>
        </div>
        <iframe
            src="file:///Users/yuweihai/Desktop/%E6%A1%8C%E9%9D%A2/%E5%BC%80%E8%AF%BE%E5%90%A7/%E5%B0%8F%E7%99%BD003%E6%9C%9F/vue04/code/admin/addNewsPage.html"
            frameborder="0" width="800px"></iframe>
    </div>
</body>
<script>
    let lis = document.querySelectorAll("li");
    Array.from(lis).forEach(v => {
        v.onclick = function () {
            Array.from(lis).forEach(value => {
                if (this == value) {
                    this.style.color = "rgb(255, 208, 75)";
                    let iframeNode = document.querySelector("iframe");
                    if (this.textContent == "新闻添加") {
                        iframeNode.src = "file:///Users/yuweihai/Desktop/%E7%9B%AE%E5%BD%95/2201/vue/admin/addNewsPage.html";
                    } else {
                        //新闻列表
                        iframeNode.src = "file:///Users/yuweihai/Desktop/%E7%9B%AE%E5%BD%95/2201/vue/admin/newsListPage.html";
                    }
                } else {
                    value.style.color = "white";
                }
            })
        }
    })

</script>

</html>